package com.lzp.controller;

import com.lzp.pojo.User;
import com.lzp.utils.JSONResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @description: user API
 * @author: lzp
 * @createTime: 2021-07-25 19:53
 **/
//@Controller
@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/getUserMvc")
    @ResponseBody
    public JSONResult getUserMvc() {
        User user = new User();
        user.setName("lzp");
        user.setAge(19);
        user.setPassword("password");
        user.setBirthday(new Date());
        return JSONResult.ok(user);
    }

    @GetMapping("/getUser")
    public JSONResult getUser() {
        return getUserMvc();
    }



}


